tone_synth object

This method rewinds the cursor to a previous position.

bool rewind(double beats)

Parameters:
beats
Number of beats to rewind.

Return value:
true on success, false on failure.

Remarks:
Rewinding is useful if you want to go back to a certain position relative to where the cursor is at present.

Example:
// Write a chord, two melody notes, then rewind to add some more.

tone_synth synth;

void main()
{
synth.tempo=120;
synth.waveform_type=2;
synth.note("C4", 4);
synth.note("E4", 4);
synth.note("G4", 4);
synth.waveform_type=3;
synth.note("C5", 2);
synth.rest(2);
synth.note("C6", 2);
synth.rewind(1.333);
synth.note("E5", 0.666);
synth.rest(0.666);
synth.note("G5", 0.666);
synth.rest(0.666);
synth.write_wave_file("synth.wav");
}